/**
 * 
 * @brief  bsp_check.h
 * @param  None
 * 
 * @author xhq
 * @date   2024/11/14
 * 
 */
#ifndef __SRC_BSP_CHECK_H__
#define __SRC_BSP_CHECK_H__

/* include */
#include "typedef.h"
#include "global_variables.h"

/* define */


/* typedef */
struct bsp_check_type
{
    uint8_t init_flag;
    
    const uint32_t (*init)(void);
    const uint8_t (*p_bcc_calculate)(uint8_t * pbuf, uint32_t len);
    const uint8_t (*p_bcc_check)(uint8_t * pbuf, uint32_t len);
    const uint16_t (*p_crc_calculate)(uint8_t * pbuf, uint16_t len);
    const uint8_t (*p_crc_check)(uint8_t * pbuf, uint16_t len);
};

/* global varibles */

/* private function */

// 校验函数
uint8_t bsp_bcc_calculate(uint8_t * pbuf, uint32_t len);
uint8_t bsp_bcc_check(uint8_t *pbuf, uint32_t len);
uint16_t bsp_crc16_xmodem_calculate(uint8_t * pbuf, uint16_t len);
uint8_t bsp_crc16_xmodem_check(uint8_t *pbuf, uint16_t len);


#endif